-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PY] Implement logical expected conditions in Python #7406
[PY] Implement logical expected conditions in Python #7406
Conversation
02ca4cf
to
c170625
Compare
c170625
to
f025061
Compare
result = expected_condition(driver) | ||
if not result: | ||
return False | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return True
should be outside the for loop.
Many expected conditions sometimes return the element or object you're waiting for.
Should this return a list of all results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(1) (facepalm) fixed
(2) That's a good idea. the all_of
function now returns every EC's result in a list; it could then be parsed for elemental results if needed.
Replicates the functionality of Java's AND / OR / NOT expected conditions. Because of reserved word constraints in Python, these are named: OR: `any_of(*expected_condition)` AND: `all_of(*expected_condition)` NOT: `none_of(*expected_condition)` Each function takes an unlimited number of expected_conditions as arguments. Implements SeleniumHQ#7121
f025061
to
ead2a2c
Compare
LGTM. |
Is there any way I can help get this merged into master? |
Replicates the functionality of Java's AND / OR / NOT expected conditions.
Because of reserved word constraints in Python, these are named:
OR:
any_of(*expected_condition)
AND:
all_of(*expected_condition)
NOT:
none_of(*expected_condition)
Each function takes an unlimited number of expected_conditions as arguments.
Implements #7121
X
in the preceding checkbox, I verify that I have signed the Contributor License Agreement